package com.qire.manhua.model.vo;

import android.graphics.Color;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;

import com.qire.common.support.base.BaseVO;

public class CommentReplyVO extends BaseVO {

    public int      id;             //: 27067, 当前评论的ID，可能是漫画评论，也可能是回复评论
    public int      userid;         //: 11128282,
    // 暂未使用
    public int      reply_id;       //: 19558, 回复 回复评论的ID
    // 暂未使用
    public int      post_id;        //: 19558, 回复 漫画评论的ID
    public String   content;        //: "我希望男主角和女主角和好的时机就要叫人有些人都是败类应该被赶出去这样男主角和女主角就不会遭遇这么多的苦。",
    public String   create_time;    //: "02-03 00:01",
    public int      like_count;     //: 1,
    public int      replie_count;   //: 0,
    public int      like;           //: 0 //0否 1 是 我是否点赞
    public String   atwho;          //: "LMINGSI??",
    public UserInfo user_avatar;    //: {UserInfo},

    public CharSequence buildReplyContent() {
        // 拼接 @某某：XXXX
        SpannableStringBuilder contentSpannable = new SpannableStringBuilder("@" + atwho + ": " + content);

        int commentByEnd = atwho.length() + 3;
        int commentEnd = contentSpannable.length();

        contentSpannable.setSpan(new ForegroundColorSpan(Color.rgb(0x99, 0x99, 0x99)),
                0, commentByEnd, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
        contentSpannable.setSpan(new ForegroundColorSpan(Color.rgb(0x33, 0x33, 0x33)),
                commentByEnd, commentEnd, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);

        return contentSpannable;
    }

    public class UserInfo {
        // 暂未使用
        public int      id;         //: 11128282,
        public String   user_name;  //: "好人一生平安（天天好心情）",
        public String   user_img;   //: "https://thirdwx.qlogo.cn/mmopen/vi_32/kUgXE9azak2UbQb3pk3e1s0273QCgmvkVlkmC2XGChCniaXEvP9IDDah84eFCl6Rv2dwNyWnqWzuWaJRvN62oCA/132",
        public int      vipType;    //: 0,
    }

}
